<%--
  Created by IntelliJ IDEA.
  User: qiliping
  Date: 15/11/22
  Time: 下午12:20
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="paging" uri="paging-taglib" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>


<html>
<head>
    <title>理财顾问管理</title>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            业务团队管理
            <small>理财顾问管理</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/main">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    业务团队管理
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    理财顾问管理
                </a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>
<!-- END PAGE HEADER-->
<!------内容区----->
<div class="main">
    <form action="${ctx}/team/sale_man_list" method="get">
        <div class="row">
            <div class="col-md-12">
                <div class="search">
                    <div class="form-group">
                        <label class="control-label">姓名：</label>
                        <input type="text" name="q" value="${q}" class="form-control form-control-inline"/>
                    </div>

                    <div class="form-group">

                    <span class="actions">
                        <input class="btn blue" type="submit" value="搜索"/>
                    </span>
                    </div>
                </div>
            </div>
        </div>

       <%-- <div class="row">
            <div class="col-md-12">
                <div class="text-right">
                    <div class="btn-group status-filter">
                        <label class="btn btn-default active">
                            <a class="toggle checked" href="${ctx}/agent">所有</a>
                             </label>
                        <label class="btn btn-default">
                            <a class="toggle" href="${ctx}/agent?status=0">待审核</a>
                            </label>
                        <label class="btn btn-default">
                            <a class="toggle" href="${ctx}/agent?status=1">已通过</a>
                           </label>

                    </div>
                </div>
            </div>--%>
        </div>

        <div class="row">
            <div class="col-md-12">
                <table class="table table-striped table-hover zqy-table">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th></th>
                        <th>姓名</th>
                        <th>所在地</th>
                        <th>所属公司</th>
                        <th>申请时间</th>
                        <th>状态</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach var="item" items="${salesman}">
                        <tr>
                            <td>${item.agentId}</td>
                            <td>
                                <img src="${item.agentPic}" width="50px" height="50px">
                            </td>
                            <td>
                                <a href="${ctx}/team/sale_man_detail?id=${item.agentId}">${item.agentName}</a>
                            </td>
                            <td> ${item.provinceName} ${item.cityName} ${item.districtName}</td>
                            <td>
                                <c:choose>
                                    <c:when test="${item.agentId==1}">
                                        总部
                                    </c:when>
                                    <c:otherwise>
                                        <c:choose>
                                            <c:when test="${item.parentAgentId==0}">
                                                未分配公司
                                            </c:when>
                                            <c:otherwise>
                                                ${item.parentAgentName}
                                            </c:otherwise>
                                        </c:choose>
                                    </c:otherwise>
                                </c:choose>


                            </td>

                            <td>
                                <fmt:formatDate value="${item.applyTime}" pattern="yyyy-MM-dd"/>
                            </td>
                            <td>
                                <c:choose>
                                    <c:when test="${item.status == 0}">
                                        待审核
                                    </c:when>
                                    <c:when test="${item.status == 1}">
                                        已通过
                                    </c:when>
                                    <c:when test="${item.status == 2}">
                                        已拒绝
                                    </c:when>
                                    <c:when test="${item.status == 3}">
                                        已取消
                                    </c:when>
                                </c:choose>

                            </td>
                            <td>
                                <c:choose>
                                    <c:when test="${item.status == 0}">
                                        <a href="${ctx}/team/sale_man_detail?id=${item.agentId}">审核</a>
                                    </c:when>
                                    <c:otherwise>
                                        <a href="${ctx}/team/sale_man_detail?id=${item.agentId}">查看详情</a>
                                    </c:otherwise>
                                </c:choose>

                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <div class="text-center">
                    <ul class="pagination">
                        <paging:paging pageIndex="${pageIndex}" totalPage="${totalPage}" href="${ctx}/team/sale_man_list" htmlTag="li"></paging:paging>

                    </ul>
                </div>

            </div>
        </div>

    </form>
</div>
<!------[end]内容区----->

</body>
</html>